diff options
Diffstat (limited to 'app/[lng]')
| -rw-r--r-- | app/[lng]/evcp/(evcp)/(procurement)/rfq-last/[id]/layout.tsx | 23 | ||||
| -rw-r--r-- | app/[lng]/partners/(partners)/rfq-last/[id]/page.tsx | 37 |
2 files changed, 58 insertions, 2 deletions
diff --git a/app/[lng]/evcp/(evcp)/(procurement)/rfq-last/[id]/layout.tsx b/app/[lng]/evcp/(evcp)/(procurement)/rfq-last/[id]/layout.tsx index 6dcbf018..8fffb221 100644 --- a/app/[lng]/evcp/(evcp)/(procurement)/rfq-last/[id]/layout.tsx +++ b/app/[lng]/evcp/(evcp)/(procurement)/rfq-last/[id]/layout.tsx @@ -4,7 +4,6 @@ import { Separator } from "@/components/ui/separator" import { SidebarNav } from "@/components/layout/sidebar-nav" import { formatDate } from "@/lib/utils" import { Button } from "@/components/ui/button" -import { Badge } from "@/components/ui/badge" import { ArrowLeft, Clock, AlertTriangle, CheckCircle, XCircle, AlertCircle, Calendar, CalendarDays } from "lucide-react" import { RfqsLastView } from "@/db/schema" import { findRfqLastById } from "@/lib/rfq-last/service" @@ -47,7 +46,27 @@ export default async function RfqLayout({ // 2) DB에서 해당 협력업체 정보 조회 const rfq: RfqsLastView | null = await findRfqLastById(rfqId) - // 3) 사이드바 메뉴 + // 3) 취소된 RFQ 접근 제어 + if (rfq?.status === "RFQ 삭제") { + return ( + <div className="p-4 space-y-4"> + <Alert variant="destructive"> + <AlertCircle className="h-4 w-4" /> + <AlertTitle>접근 불가</AlertTitle> + <AlertDescription> + 이 RFQ는 삭제되어 접근할 수 없습니다. + </AlertDescription> + </Alert> + <div className="p-4 bg-muted rounded-lg"> + <p className="text-sm font-medium mb-2">삭제 사유:</p> + <p className="text-sm text-muted-foreground whitespace-pre-wrap">{rfq.deleteReason}</p> + </div> + + </div> + ); + } + + // 4) 사이드바 메뉴 const sidebarNavItems = [ { title: "견적 문서관리", diff --git a/app/[lng]/partners/(partners)/rfq-last/[id]/page.tsx b/app/[lng]/partners/(partners)/rfq-last/[id]/page.tsx index 7a68e3a2..9052de6f 100644 --- a/app/[lng]/partners/(partners)/rfq-last/[id]/page.tsx +++ b/app/[lng]/partners/(partners)/rfq-last/[id]/page.tsx @@ -86,6 +86,23 @@ export default async function VendorResponsePage({ params }: PageProps) { if (!rfq || !rfq.rfqDetails[0]) { notFound() } + + // 취소된 RFQ 접근 제어 + if (rfq.status === "RFQ 삭제") { + return ( + <div className="flex h-full items-center justify-center"> + <div className="text-center max-w-md"> + <h2 className="text-xl font-bold">접근 불가</h2> + <p className="mt-2 text-muted-foreground">이 RFQ는 삭제되어 접근할 수 없습니다.</p> + <div className="mt-4 p-4 bg-muted rounded-lg text-left"> + <p className="text-sm font-medium mb-2">삭제 사유:</p> + <p className="text-sm text-muted-foreground whitespace-pre-wrap">{rfq.deleteReason}</p> + </div> + + </div> + </div> + ) + } const rfqDetail = rfq.rfqDetails[0] @@ -99,8 +116,28 @@ export default async function VendorResponsePage({ params }: PageProps) { with: { quotationItems: true, attachments: true, + priceAdjustmentForm: true, } }) + + // 취소된 RFQ 접근 제어 (vendor response가 취소 상태인 경우) + if (existingResponse?.status === "취소" || rfqDetail.cancelReason) { + return ( + <div className="flex h-full items-center justify-center"> + <div className="text-center"> + <h2 className="text-xl font-bold">RFQ 취소됨</h2> + <p className="mt-2 text-muted-foreground"> + 이 RFQ는 취소되어 더 이상 견적을 제출할 수 없습니다. + </p> + {rfqDetail.cancelReason && ( + <p className="mt-4 text-sm text-muted-foreground"> + 취소 사유: {rfqDetail.cancelReason} + </p> + )} + </div> + </div> + ) + } // PR Items 가져오기 const prItems = await db.query.rfqPrItems.findMany({ |
